//
//  DetailMainCell.m
//  CarStore
//
//  Created by 千锋 on 16/1/27.
//  Copyright (c) 2016年 1000phone. All rights reserved.
//

#import "DetailMainCell.h"
#import "HomePageModel.h"

@interface DetailMainCell ()

@property (weak, nonatomic) IBOutlet UIImageView *imgView;
@property (weak, nonatomic) IBOutlet UILabel *titleLabel;
@property (weak, nonatomic) IBOutlet UILabel *typeLabel;
@property (weak, nonatomic) IBOutlet UILabel *factoryPriceLabel;
@property (weak, nonatomic) IBOutlet UILabel *lowestPriceLabel;

@end

@implementation DetailMainCell

- (void)awakeFromNib {
    // Initialization code
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];
    // Configure the view for the selected state
}

- (void)setModel:(HomePageModel *)model
{
    [self.imgView sd_setImageWithURL:[NSURL URLWithString:model.image] placeholderImage:[UIImage imageNamed:@"placeholder_image"]];
    self.titleLabel.text = model.serial_name;
    self.typeLabel.text = model.car_type_name;
    
    CGFloat guidePrice = [model.guide_price floatValue]/10000;
    self.factoryPriceLabel.text = [NSString stringWithFormat:@"%.2f万",guidePrice];
    
     CGFloat lowPrice = [model.guide_price floatValue]/10000;
    self.lowestPriceLabel.text = [NSString stringWithFormat:@"%.2f万",lowPrice];
    
}

@end
